<template>
	<view>
		<status-bar title='赠送记录'></status-bar>
		<view class="p-left40 p-right40" v-if="list.length">
			<view class="d-flex j-sb a-center p-top30 p-bot30 bot_bor_ee" v-for="(item,index) in list" :key="index">
				<view>
					<view class="size30 color_33 bold m-bot10">{{ item.userFind.v_name }}（{{ item.userFind.v_tel }}）
					</view>
					<view class="size26 color_99">{{ item.addDate }}</view>
				</view>
				<view class="point size40">{{ item.con_jifen }}分</view>
			</view>
		</view>
		<empty v-if="noData" cat='3' msg='您还没有相关记录哦'></empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				noData: false,
				page: 1,
				pageNum: 10,
				noMore: false
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				this.$http.post({
					url: '/osmxcxApi/getGiveLog',
					data: {
						page: this.page,
						pageNum: this.pageNum
					}
				}).then(res => {
					let result = res.data || []
					this.list = this.page == 1 ? result : this.list.concat(result)
					if (result.length < this.pageNum) this.noMore = true
					if (!this.list.length) this.noData = true
				})
			}
		},
		onReachBottom() {
			if (this.noMore) return
			this.page++
			this.getList()
		}
	}
</script>

<style lang="scss" scoped>
	.point {
		color: #FF9900;
	}
</style>